<!--这是添加票种组件-->
<template>
  <div class="app-container">
    <el-form :model="postForm" :rules="rules" ref="postForm" label-width="220px" label-position="right">
      <el-form-item label="票种类型：" prop="ticketType">
        <el-select v-model="postForm.ticketType" placeholder="请选择" style="width: 650px" @change="ticketSelect">
          <el-option v-for="item in ticketOptions" :key="item.key" :label="item.value" :value="item.key"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="票种名称：">
        <el-input v-model="postForm.ticketName" placeholder="请输入活动名称" style="width: 650px"></el-input>
      </el-form-item>
      <el-form-item label="票种说明：">
        <el-input style="width: 650px"
          type="textarea"
          :rows="5"
          placeholder="票种说明"
          v-model="postForm.ticketExplain">
        </el-input>
      </el-form-item>
      <el-form-item label="价格(元)：" prop="price">
        <el-input v-model="postForm.ticketPrice" placeholder="请输入价格" style="width: 650px"></el-input>
      </el-form-item>
      <el-form-item label="积分可抵扣金额：">
        <el-input v-model="postForm.integralPrice" placeholder="请输入积分可抵扣金额" style="width:650px"></el-input>
      </el-form-item>
      <el-form-item label="vip折扣：">
        <el-input v-model="postForm.vipDiscount" style="width: 80px;float: left;margin-right: 10px;"></el-input>
        <span style="float: left;padding-right: 10px;">%</span>
				<span style="color:red;float: left;line-height: 22px;width: 600px;margin-top: 5px;">注意：会员以上级别购买才可参与折扣。票价 * 比例 = 当前价格。例如 75% 同于 7.5 折，0% 即票价免费。系统默认初始化 100%</span>
      </el-form-item>
      <el-form-item label="svip折扣：">
        <el-input v-model="postForm.svipDiscount" style="width: 80px;margin-right: 10px;"></el-input>%<span></span>
      </el-form-item>
      <el-form-item label="票总数：" prop="ticketNum">
        <el-input v-model="postForm.ticketNum" placeholder="请输入票总数" style="width: 650px"></el-input>
      </el-form-item>
      <el-form-item label="排序：">
        <el-input v-model="postForm.ticketOrder" style="width: 150px"></el-input>
				<span style="color:red">注意：排序必须为纯数字,不填默认为0</span>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-check" @click="submitForm">保存</el-button>
        <el-button type="info">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>

const postForm = {
  ticketType: '免费票', // 票种类别 必填
  ticketName: null, // 票种名称
  ticketExplain: null, // 票种说明
  ticketPrice: null, // 票价 当选了收费票时， 必填
  integralPrice: null, // 积分可抵扣金额
  vipDiscount: null, // vip折扣
  svipDiscount: null, // svip折扣
  ticketOrder: null, // 票排序
  ticketNum: null // 票总数
}

const ticketOptions = [
  { key: 0, value: '免费票' },
  { key: 1, value: '收费票' }
]

const rules = {
  ticketType: [{ required: true, message: '请选择票种类型', trigger: 'blur' }],
  price: [{ required: true, message: '请输入票价', trigger: 'blur' }],
  ticketNum: [{ required: true, message: '请输入票总数', trigger: 'blur' }]
}

export default {
  components: {
  },
  data() {
    return {
      postForm: Object.assign({}, postForm),
      rules,
      ticketOptions,
      isFreeTicket: true
    }
  },
  methods: {
    ticketSelect() {
    },
    submitForm() {
    }
  }
}
</script>
<style scoped>
	
</style>
